﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using PaymentHelper.Core.CommonUtils;
using System.Web.Mvc;

namespace PaymentHelper.Core.MVCUtils
{
    public abstract class PaymentHelperController:Controller
    {
        public PaymentHelperController()
        {
        }

        /// <summary>
        /// SystemName of payment method
        /// </summary>
        protected abstract string SystemName
        {
            get;            
        }

        /// <summary>
        /// Validate payment info from user
        /// </summary>
        /// <param name="frmData">form contains data from user</param>
        /// <returns>
        /// Valid: return null
        /// Invalid: retunrn list of warning 
        /// </returns>
        public abstract IList<string> ValidatePaymentInfo(FormCollection frmData);

        public virtual ActionResult GoToHome()
        {
            return Redirect(PHUtility.GetSiteUrl());
        }
    }
}
